Symbolic Language For Trade Matching

ABSTRACT

A symbolic modeling language for trade matching provides techniques to describe the specialized operations of a match engine in a form that can be understood by business analysts and readily translated into program code and test cases by developers and testers. Associated techniques for calculating implied markets and testing can expedite match engine development, testing and maintenance.

TECHNICAL FIELD

This disclosure relates to a symbolic language for trade matching.

BACKGROUND

The design of reliable high-speed software for a match engine (e.g., onethat recognizes implied spread markets) poses a number of problems for acommodities exchange, and in particular to the software architect orprogram manager responsible for the implementation. Aspects of theseproblems include the complexity of the market, the speed at which theexchange must operate, and the need to quickly implement reliableelectronic trading software.

The complexity of the market arises from, among other things, the largenumber of potential order combinations. For example, a single commoditywith 72 delivery months has 2556 (72*71) potential spread contracts. Foreven the simplest implied markets where orders in two contracts imply anorder in a third, there are 6,530,580 (2556*2555) possible combinations.As the number of contracts involved in the implication gets larger, thenumber of possible combinations grows exponentially. The problem isaggravated when multiple commodities are linked by intercommodityspreads that can also take part in implication, especially sincedifferent commodities can open and close at different times, therebyaffecting which orders can take part in implication.

The speed of electronic commodities trading has increased by a factor ofabout a hundred since 2001. While in 2001 there might have been 5000lots of Light Crude traded overnight on the New York Mercantile Exchange(NYMEX) electronic trading platform, by 2007, the daily volume couldattain 500,000 lots or more. The growth in overall volume is likely tocontinue, given the ever-increasing demand for energy-relatedcommodities.

During the period from 2001 to the present, many commodities exchangeshave become publicly-traded companies subject to increased competitionand investor scrutiny. The ability of an exchange to specify, design andtest new electronic trading software is crucial in maintaining volumegrowth and its positive effect on shareholder value. This combination ofhigh complexity, high speed and reduced time to market is coupled withan increased need for reliability. In 2001, electronic trading at NYMEXwas an overnight service accounting for less than 10% of the volumetraded. Orders were received at a rate of 1-2 per minute and a call-innumber was available to assist traders with technical and businessissues. By 2007, over 90% of the exchange's volume was tradedelectronically at an average message rate of over 100 per second. Anoutage that would have passed unnoticed in 2001 would now affect dozensof traders and millions of dollars in transactions.

These problems are common to modern exchanges, since the majority oftheir revenue comes from electronic trading and the cost of inaccuratecalculations or lost business from system failures can be significant.

SUMMARY

In some implementations, a symbolic modeling language for trade matchingprovides techniques to describe the specialized operations of a matchengine in a form that can be understood by business analysts and readilytranslated into program code and test cases by developers and testers.Associated techniques for calculating implied markets and testing canexpedite match engine development, testing and maintenance.

The details of one or more implementations are set forth in theaccompanying drawings and the description below. Other features,objects, and advantages will be apparent from the description anddrawings, and from the claims.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 illustrates manual testing of trades.

FIG. 2 illustrates an implementation of a methodology for programmingand testing a match engine using a Match Engine Modeling Language(MEML).

FIGS. 3A-7C illustrate the concrete syntax of one implementation of aMEML.

FIGS. 8A-21 illustrate the abstract syntax of an implementation of aMEML.

FIG. 22 illustrates the syntactic mapping of an implementation of aMEML.

FIGS. 23-26 illustrate the semantic mapping of an implementation of aMEML.

FIGS. 27-34 illustrate the pragmatics of an implementation of a MEML.

FIGS. 35-36 illustrate an implementation of derivation of a matchingalgorithm for a new order type.

FIG. 37 illustrates an implementation of an automated test tool.

FIG. 38 illustrates an example screen shot in an implementation of anautomated test tool.

FIG. 39 illustrates an implementation of a business methodologyassociated with an automated test tool.

DETAILED DESCRIPTION

The following is a detailed description of preferred implementations, aswell as some alternative implementations, of a symbolic language fortrade matching and related systems and methods.

An example of a technique and match engine for identifying impliedmarkets (and the possible trades in such markets) can be found incommonly-assigned U.S. Pat. No. 7,039,610, which is hereby incorporatedherein by reference.

General Overview

In some implementations, a symbolic modeling language for trade matching(a Match Engine Modeling Language) provides techniques to describe thespecialized operations of a match engine in a form that can beunderstood by business analysts and readily translated into program codeand test cases by developers and testers. Associated techniques forcalculating implied markets and testing can expedite match enginedevelopment, testing and maintenance.

Modeling Language

In some implementations, the Match Engine Modeling Language (MEML) is aDomain Specific Visual Modeling Language (DSVL). The language appliesspecifically to the trade matching system or “match engine” component ofthe trading network. The use of a DSVL is preferred in some casesbecause it can be more easily adapted for use with current and emergingsoftware development tools. As a constructed language, DSVLs aretypically described as including: (1) syntax, e.g., the formal relationof signs to one another; (2) semantics, e.g., the relation of signs tothe real-world entities that they represent and (3) pragmatics, e.g.,the relation of signs to, for example, human interpreters.

Generally speaking, domain specific modeling languages are limited to aparticular semantic domain. If the domain is sufficiently limited andthe language sufficiently well-defined, then many useful tasks can bedefined algorithmically and executed by machines instead of humanbeings. A domain specific visual modeling language is a particularimplementation of this concept.

The symbolic language for trade matching (i.e., the MEML) can beimplemented to comprise the five commonly-understood elements of a DSVL:(1) a concrete syntax consisting of visual symbols; (2) an abstractsyntax that sets rules on how the symbols can be combined to formmeaningful expressions; (3) syntactic mapping through which expressionsin the MEML are associated with expressions in another language with aformal syntax, e.g., an XML message or a computer programming language;(4) a semantic domain, e.g., the internal operations of a match enginein a trading network; and (5) semantic mapping that associates visualexpressions and their transformations with states and events in thetrading system. The following disclosure describes each of theseelements, as they apply to an implementation of the symbolic languagefor trade matching.

In one aspect, the symbolic language for trade matching makes itpossible to represent the computational requirements of the tradingsystem in a form suitable for mathematical analysis. In some cases,existing mathematical theories and/or widely known algorithms mayprovide solutions that are reliable and low in cost. In other cases, thevisual representation will yield well-posed problems that can be solvedby developers or analysts without a specialized knowledge of trading andpossibly with only basic mathematical knowledge. Regardless, the visualrepresentation aspect of the language allows the analyst to see andspecify the correct answer for testing, which is desirable regardless ofhow the solution was developed.

Testing and Programming a Match Engine

Advantages of electronic trading systems and the techniques foridentifying and creating implied markets include, e.g., (1) deepermarkets and (2) greater market efficiency. However, given the complexityof the market and the immense number of possible actual and impliedoutright, spread and strip orders, the electronic system must be able toreliably identify and execute those actual and implied trades. Thus, itis desirable that the system be (1) programmed in a manner thatanticipates the immense number of possible trades and (2) tested toensure that those possible trades execute as they should.

Generally, the testing of an electronic trading system is a manualprocess based on written scripts and manual entry of data into agraphical user interface. An example screen shot of such testing isshown in FIG. 1. Users (e.g., analysts) identify trading scenarios, andcreate “scripts” that detail each step of the scenario. Each step mayinclude, for example, one or more orders. In the example shown in FIG.1, the user is attempting to test the scenario that that several heatingoil (“HO”) spreads, i.e., steps 3-5, in combination with twointer-commodity spreads for crude oil (“CL”) and heating oil, i.e.,steps 6-7, imply a crude oil spread.

These scripts may be written by test managers working from spreadsheetsor written notes prepared by business analysts. The results would beconfirmed manually by testers. These techniques are time-consuming andprone to clerical errors. Given these tedious techniques, trade setmatching systems are often limited to simple two-order implieds. Sinceit is preferred that a trading system be tested thoroughly, this is notan efficient approach for testing a large number of trading scenarios.Moreover, manual scripts cannot cope with advanced optimizationtechniques where orders are processed in batches and market data issometimes deferred until a significant change in order state hasoccurred.

Generally, programming a match engine is a similarly tedious process.For each type of trading scenario envisioned by an analyst, a script isgenerated. Then, code is created that implements the script. Given thelarge number of possible trading scenarios, programming a match engineis a lengthy, costly process. Maintenance of even simple matchingsoftware can be difficult because the underlying concepts cannot bedocumented clearly.

A symbolic language for trade matching can be implemented to address theneed of the exchange to implement and maintain high-speed,high-reliability software in a shorter time and with fewer resources.Such a symbolic language may increase the productivity of specializedanalysts and developers through a visual modeling language and relatedtools for automated program and test data generation. The modelinglanguage and automated test tool make it possible to design, implementand test trade set matching systems for a much broader class of ordercombinations. An exchange or related business can deploy superior tradeset matching software in a shorter time and with fewer resources.

Associated with the MEML is an automated test tool that can translatevisual expressions into inputs that can be transmitted to a matchengine. The tool calculates the required output of the match engine andcan compare the output from an actual system with a calculatedreference. In some applications, the automated test tool is mainly usedto verify that newer versions of a match engine continue to meet theoriginal specification. Also, visual expressions of the symboliclanguage may be on a computer screen and automatically translated intosequences of messages for transmission to a specific match engine.

The MEML includes techniques for calculating implied markets for severalorder types. In principle, a computer program that calculates theexpected output of the match engine for testing purposes performs thesame calculations as the match engine. Thus, visual expressions in theMEML could be assembled into a complete specification of a match engine.The MEML can be used to create a testable specification of the matchengine and the automated test tool is used to confirm that the matchengine meets this specification. The test code, derived from the MEMLtestable specification, can be used as a starting point for a trade setmatching system and the automated test system can be used to verify thatrefinements made by human programmers continue to meet the originalspecification.

Some Implementations of a Symbolic Language for Trade Matching andRelated Systems/Processes

The symbolic language and related system/processes can be applied to anytrading system where an incoming order can be matched with a combinationof two or more orders previously received and stored, For example,implementations are applicable to trading systems where combinations oforders are possible, including outright future orders, spread orderswith two or more legs and strip orders, regardless of whether thesecombinations are traded in practice. Generally speaking, the symboliclanguage and related system/processes relate primarily to the part ofthe trading system known as the match engine.

An implementation can consist of three related parts:

(1) a visual domain specific modeling language (e.g., the MEML) forspecifying the operations to be performed by the match engine;

(2) a technique for calculating implied markets for order combinationsthat can be expressed in the MEML; and

(3) for any specific match engine, an automated test tool thattransforms expressions in the MEML into inputs and outputs (e.g., “testdata”) for testing a specific trade set matching system.

In some implementations, the basic visual elements of the MEML have beenchosen to facilitate their use in illustrations that assist businessanalysts, software architects, developers and others in describing andunderstanding how other components of the trading network interact withthe match engine. For example, the reception of an order can be shown inan animation as the movement of an order symbol onto a grid showingpreviously received orders. This provides an exact specification of theend state of the match engine along with an illustration of how othertrading network components might drive the match engine to that state.

An implementation can be characterized by the intuitiveness of someelements in its modeling language, which can be based on simple ordertypes for which the calculation of implied markets is already known. Animplementation can provide a visual representation so that users cantranslate the specialized procedures for more complex order types intoprograms for many different trading systems.

Implementations of a MEML

In one implementation, the MEML comprises the five commonly-understoodelements of a Domain Specific Modeling Language (i.e., it is a“five-tuple”): (1) a concrete syntax, which can consist of visualsymbols related to the internal operations of a match engine; (2) anabstract syntax, which can set rules on how the symbols can bemanipulated; (3) syntactic mapping, through which an event is associatedwith the transformation of one visual expression into another; (4) asemantic domain, which can consist of order matching in a match engine;and (5) semantic mapping, which associates MEML expressions with thereal-world entities they represent, i.e., the states and events in thematch engine being modeled.

FIG. 2 illustrates how these five elements in an implementation of theMEML work together in the context of programming and/or testing a matchengine. The large block 10 represents the semantic domain. The semanticdomain 10 encompasses all match engines that can ultimately be describedin terms of input events, internal states, and outputs (e.g., as aTuring Machine). Electronic computing systems may in theory be describedas Turing Machines and the Turing Machine may itself be described as aFinite State Machine. The semantic domain of MEML therefore canencompass any electronic trading system. The semantic domain 10encompasses blocks 11-21 because it represents the context in which animplementation of the MEML operates.

Blocks 11-20 are encompassed by block 21. Block 21 represents therequirements for a specific match engine within the semantic domain 10.The requirements 21 can be written by a business analyst and generallydefine the properties and behavior of a specific match engine. Therequirements can be expressed in natural language (e.g., English) withnumerical examples. For example, a business analyst might writerequirements for a match engine that include the ability to detect andtrade implied markets.

Based on the requirements 21, a functional specification is drafted(11). The functional specification can be written in both naturallanguage and expressions in the modeling language (i.e., the MEML). Theexpressions in the MEML are constructed according to the concrete syntaxand the abstract syntax. The expressions correspond to the requirementsof the match engine 21 according to the semantic mapping. Theexpressions form a model (which may be complete or incomplete) of thedesired match engine.

The process then breaks into two separate legs. On one leg, a computerprogram is written (18) that implements the specification of block 11.Aspects of the executable code correspond to the states, input eventsand output messages that are the conceptual basis of the semantic domain10 (see block 19). Put another way, an object of the executable code isto cause the finite state machine to behave in a manner consistent withthe semantic domain 10 and the requirements of the match engine (21).

After the code is written, it is started and waits for input in adefined initial state (20). The code responds to input messages inaccordance with the specification of block 11. At this point, generallyspeaking, the code is being run for test purposes as it may bepreliminary and not fully debugged. In some other implementations (e.g.,non-critical applications), the code can be considered complete at thispoint.

For testing purposes, input scenarios are created for the match engineusing order messages (e.g., add, modify or cancel) according to theconcrete syntax and the abstract syntax (12). Additional scenarios canbe created from natural language expressions according to the semanticmapping (12) or derived formally from the model of block 11. Incontemporary software development, it is common for work on parts of thefunctional specification to begin as soon as their governingrequirements are known. The advantage of starting early typicallyoutweighs the cost of revising the model when the business requirementsare completed and reviewed in their entirety. It is also common for theanalyst to describe a representative scenario which must be translatedinto model expressions covering every possible variation. A simplederivation of this kind is to translate all the buys into sells and viceversa. The set of testable expressions made by, e.g., a test author,forms a testable model of the match engine.

The scenarios of block 12 are converted into XML messages (e.g., “testdata”) according to the syntactic mapping (13). An algorithm can be usedto produce the expected results of the match engine so that a separatesyntactic mapping associates the visual expression of the MEML withexecutable code in the in the automated test program. This allowsresults to be calculated based on the model of the match engine.

The test data is transmitted to the executable code for the match engineby the automated test program (14). The executable code being tested isthat which is written in block 18 and started in block 20. The automatedtest program compares the output of the code with the results calculatedfrom the model (15).

It is then determined whether the executable code for the match engineproduces output that matches the results calculated from the model (16).If it does, the executable code implements the model. If it does not,the executable code does not implement the model and is revised. Next,it is determined if the semantic mapping associates every expression inthe model with a requirement of the specification set forth in block 21(17). If the executable code implements the model and the semanticmapping associates every expression in the model with the requirements,the code (of block 18) meets the requirements. Code that meets therequirements can be considered ready for use as a match engine.

Each element of the MEML will be discussed in detail.

Concrete Syntax

FIGS. 3A-7C illustrate the concrete syntax of one implementation of aMEML. Generally speaking, the concrete syntax includes visual symbolsrelated to the internal operations of a match engine. A user who is, forexample, testing trades communicates with the match engine by usingsymbols that are part of the concrete syntax. The following is adiscussion of several aspects of the concrete syntax.

While one implementation of the concrete syntax is illustrated, manyother implementations and variations are possible because the appearanceof a visual element can vary substantially. Some variations may pertainto not requiring strict adherence to the formats illustrated. Forexample, decorations may be repositioned for clarity; lines and arrowsmay be drawn with different lengths, thicknesses, colors, directions,curvatures or other basic properties to make an expression easier tocomprehend; and repeated or default values may be left out. Somevariations may use entirely different symbology for illustrating trades.

FIG. 3A illustrates examples of grid elements. Generally speaking,trades in the MEML are represented on a grid that comprises gridelements. The grid elements are combined to form a worksheet onto whichorders can be placed (e.g., via electronic data entry or handwritten) insequence. The grid is discussed in more detail in connection with theabstract syntax. For context, an example of a grid is shown in FIG. 3B.Each numbered rectangle (0 to 24) corresponds to a grid element.Generally speaking, a grid element is the intersection of a product anda delivery month. The exception is a grid element associated with avirtual contract, discussed below.

In this implementation, the MEML represents every order as a spreadbetween two contracts, which may be real or “virtual.” Every order buysone contract and sells another. In the discussion of semantic mapping,it will be seen that this technique is capable of representing everypossible order that can take part in an implied market of any kind.

FIG. 3A illustrates a variety of grid elements. Item 109 represents a“virtual” contract grid element. The concept of virtual contracts isdiscussed in greater detail in the section entitled “Abstract Syntax,”but generally, the virtual contract grid element 109 enables all orders(including outrights) to be represented as spreads. Thus, an outrightorder for September heating oil is represented as a spread between avirtual contract grid element (e.g., 109) and the grid elementassociated with September heating oil. Like all grid elements, thevirtual grid element 109 has a number (101) that uniquely identifies itslocation on the overall grid. Unlike other grid elements, however, avirtual contract grid element does not have a delivery month (e.g.,items 102, 104, 106 and 108) or a product (e.g., 103, 105, 107 and 109)associated with it. In some implementations, the virtual grid element(109) is always assigned number “0”.

FIG. 3A also illustrates a conventional future contract grid element 10.The associated delivery month 102 (January 2008) and product 103 (crudeoil) are identified. Item 111 represents a future strip grid elementwhich has a virtual delivery period (FGH). Generally speaking, a futurestrip is the simultaneous purchase (or sale) of futures positions inconsecutive months. The virtual delivery period is the months of thestrip. The average of the prices for the futures contracts bought (orsold) is the price of the contract. A three-month strip, for example,consists of an equal number of futures contracts for each of threeconsecutive contract months. The delivery months 104 indicate that thisstrip is a three-month strip from January to March. The product 105 isagain crude oil.

Virtual products (not to be confused with virtual contracts) also may berepresented by grid elements. A virtual product, generally speaking, isthe combination of multiple contracts that are either all bought or allsold together in combination with another contract. A virtual productmakes it possible to define ratio spreads such as 3CL:2HU1HO, where 3lots of CL are bought, 2 lots of HU are sold and 1 lot of HO is sold.The 2HU1HO virtual product combines the two products on the sell end ofthe spread. This is shown in grid element 112. The delivery date (106)is January.

There are combinations of contracts for which a virtual product is notconvenient. These combinations are defined with a more general elementcalled the “composite contract.” For instance, four grid elements 113are associated with a “fence” order. The product is identified as afence (109) in a similar manner as products may be identified as, e.g.,crude oil (103). Generally speaking, a fence entails buying a futurescontract and hedging it with the purchase of an out-of-the-money put andthe sale of an out-of-the-money call. The premium received from the callsale is used to subsidize the purchase of the put. Item 109 is only oneexample of a fence. The fence element is shown having four basic gridelements 113 because these are used to place all of the “helper orders”required to connect the basic orders for implication. Other strategiesthat require different numbers and types of contact will requiredifferent numbers of rectangles to express the implication relationshipscorrectly. Helper orders are discussed in more detail in connection withFIGS. 4, 9, 12 and 13.

Any type of contract can be identified with the appropriate gridelement(s).

While the grid elements are associated with particular contracts, tomodel and test trades, a symbology for orders is needed. FIG. 4illustrates examples of order elements (201-203) that are utilized incombination with the grid elements.

Order element 201 is a basic order element. Solid circle 201 arepresents the buy end of the element whereas the empty circle 201 brepresents the sell end of the element. Thus, when the order element isused in conjunction with the grid elements, the solid circle 201 a isplaced on the grid element associated with the security being bought andthe empty circle 201 b is placed on the grid element associated with thesecurity being sold. In an outright purchase, the sell end of theelement (201 b) is placed on a virtual contract element (e.g., 109). Inan outright sell, the purchase end of the element (201 a) is placed on avirtual contract element (e.g., 109). A helper order 202, which is aconstituent order for a contract that has multiple legs (e.g., eachorder for the crude, heating oil and gasoline contracts of a crackspread), follows a similar symbology to that of the basic order 201(e.g., solid circle 202 a is the buy end and empty circle 202 b the sellend), but is smaller in size. Helper orders express the relationshipsbetween contracts in a combination product. They have zero price,infinitely early time and infinite volume. They have the unique propertythat all the helper orders associated with a combination must be presentin an implied order that contains the combination as a component.

Order element 203 represents an implied order. Shaded end 203 arepresents the buy end whereas the empty end 203 b represents the buyend. Implied orders, unlike basic or “real” orders, are generated by thetrading system on the behalf of traders who have entered basic orders.Implied orders are generated to deepen the market and to provide ordersin contracts where no trader has entered an actual order. In order to dothis, the trading system examines the basic orders and the helper ordersentered into the system and derives orders, which are implicit in thecombination of specific basic and helper orders. An implied order may beformed by any combination of orders where the buy ends and the sell endscan be connected to form a chain. For example, a sell outright canconnect with a buy spread from the outright month to a second month toimply a sell outright in the second month. A trader entering a buyoutright in the second month will trade with the implied order. Thisimplied trade is executed as two related real trades: the buy outrightwith the sell leg of the spread and the buy leg of the spread with thesell outright.

In addition to indicating whether a contract associated with a gridelement is being bought or sold, order elements may represent otherorder attributes either visually or through symbolic decoration. Forexample, volume may be represented by the thickness of a line andownership by color. In some cases it will be more convenient torepresent these attributes with numerals, letters or other symbolsplaced in a visual relationship with the order element. These additionsto the order elements are referred to generally as “decorations” (see,e.g., FIGS. 10A and 10B). In some implementations, the order decorations(for price, quantity, order number, etc.) correspond to attribute valuesin XML messages that a test program can transmit to a match engine. Amatch engine can be programmed in a similar manner, e.g., to recognizethe XML associated with the decorations.

In some implementations related to testing a match engine, grid elements(e.g., of FIG. 3A) are displayed on the screen of a test developer'scomputer workstation. A pointing device (e.g., a mouse) is used toindicate the end points of orders, which are then drawn and decoratedwith default values which can then be changed using the featurescommonly associated with a graphical user interface (GUI). For example,selecting a price decoration and moving the mouse-wheel alters theprice. In such an implementation, clicking an on-screen button triggersthe automatic creation of XML messages to be stored in a file for latertransmission by a test program. The visual elements of the MEML can berendered in the shapes and colors available in the GUI.

From a temporal perspective, orders in a match engine fall generallyinto two classes: (1) pre-existing orders, i.e., orders that are “on thebook” and (2) incoming orders that are not yet “on the book.” Theconcrete syntax can express incoming orders in the form of a list, asshown in FIG. 5. List 401 is an empty list whereas list 402 comprisesone order 402 a. List 403 comprises four orders 403 a-403 d, andincludes decoration to indicate the first order in the list (“Front”)and the last (“Back”). An analyst can enter orders in list format asshown, including essential information such as product and deliverymonth. Alternatively, an analyst may enter orders directly on the grid.The list is included in MEML because it corresponds directly to the datastructures available in most programming languages. Coding is faster andless error-prone when requirements are expressed in terms familiar tothe programmer.

An analyst may need to express more than the entry of the order to fullymodel and/or test a match engine. Accordingly, the concrete syntax caninclude symbology for additional functionality, such as “builder andflow elements.” For example, the table of FIG. 6 illustrates examples ofbuilder and flow elements within the concrete syntax.

The “builder elements” are associated with the creation of outputmessages by the Match Engine. A specification expressed in MEML does notdepend on either the formats of the output messages or on the specificclasses developed by the programmer to create them. However, the“builder design pattern” is a commonly-known programming technique forthis type of operation, so the symbols →T and →MD are referred to asbuilder elements in the expectation that a call to a method of a builderclass will be used to output the trade data or market data accumulatedat the point in the scenario where they appear.

The “flow elements” are used to express the sequence of operations in ascenario. FIG. 6 shows special symbols for message reception, adding anorder to a grid and other operations specific to order matching. Generalexpressions of “one state of affairs leading to another” are shown withthe same lines and arrowheads that have appeared in human pictures sincethe invention of the arrow and the blackened stick for writing on thewalls of caves.

Some implementations of the MEML concrete syntax are extensible. Forexample, the set of builder and flow elements shown in FIG. 6 can beextended with commonly-known symbols (e.g., the ellipsis “ . . . ” toindicate repetition) or with special symbols to link a MEMLrepresentation with a different form of representation.

Another aspect of the concrete syntax is the manner of illustrating to auser—off the grid—the behavior of the grid elements and order elements.Each chain element, illustrated in FIG. 7A, is associated with aparticular grid element. For example, chain element 301 is associatedwith a crude oil (CL) contract having a particular delivery month. Asdiscussed in connection with FIG. 3A, each such contract has a uniquegrid element. In FIG. 7A, chain element 302 is associated with a virtualcontract and chain element 303 is associated with a futures contract forunleaded gasoline (HU) in January 2008 (F8). Each chain element 301-303has two nodes (301 a, 301 b; 302 a, 302 b; 303 a, 303 b) associated witheither buying or selling the associated contract. For example,connecting the buy node 301 b of the CL chain element 301 to the sellnode 302 a of the virtual contract chain element 302 indicates theoutright purchase of the CL contract associated with chain element 301.Whether a particular node is a buy or sell node can vary to accommodateillustration of the trade. Chains are used in the modeling language toexpress the rules for calculating trade prices. Unlike grids and orderelements, which can also be used to express the input to the matchengine in a trading scenario used for testing, chains are used only tospecify the match engine's internal operations

Chain elements may include decorations that replicate information fromtheir associated grid elements and order elements. This is a conveniencefor the user of the modeling language that can be provided automaticallyin some implementations.

Every chain element has an associated contract type, which isrepresented by one of the textual elements shown in FIG. 7B. Every chainis an instance of an implication pattern expressed by a sequence oftextual chain elements. For example, a chain consisting of an buyoutright future followed by a sell calendar spread is an instance of theFSiFb pattern. These pattern names are used descriptively, e.g. to labeldiagrams or test cases. They are also used functionally in MEML toexpress an implication policy that the match engine must follow, asdiscussed later. Examples of textual elements and their meanings areillustrated in FIGS. 7B and 7C.

FIG. 7B shows some additional elements that can be used to expressevents other than the addition of a new order. These include modify andcancel (which require input to the match engine) as well as the “timerevent”, which is generated inside the match engine but expressed in away that preserves the Finite State Machine metamodel.

While the foregoing discussion was directed to a particular symbologyfor a concrete syntax, it also may incorporate the variety of modelinglanguages and general visual representations for describing computersystems. The exact boundaries of the match engine with respect to itssurrounding trading network will vary from one trading network toanother. A specific match engine may include general computing functionsthat can be expressed with well-known elements from flowcharts, statetransition diagrams, class diagrams, and the like.

Abstract Syntax

The abstract syntax of an implementation of the MEML is illustrated inFIGS. 8A through 21. The abstract syntax specifies how the visualelements in the concrete syntax may be combined into expressions. Itconsists of rules for, e.g., (1) combining grid elements into grids; (2)combining basic orders with helper orders; (3) placing orders on grids;(4) placing an implied order on a grid to represent the discovery of asequence of orders that can be combined; (5) moving a sequence of ordersfrom a grid to a chain; (6) placing decorators, builder elements, flowelements and other details and (7) expression of an implication policywith chain descriptors.

Later, it will be shown that the placing of an order element on a gridcorresponds to the entry of a new order into the match engine. Thismakes it possible to use the grid as a graphical user interface, e.g.,for a testing system. Other expressions in MEML correspond to internaloperations of the match engine and may not have equivalents in thetesting system interface.

The MEML represents every order as a spread between two contracts whichmay be real or virtual. Every tradable contract corresponds to a pair ofpositions on a grid. Outrights have the virtual contract as one memberof the pair, so that an outright order reduces to a single real contractto be bought or sold.

In this implementation, the simplest possible grid consists of a virtualcontract and a single real contract, which may be an outright future, anoption on a future, or any other type of contract. On the simplestpossible grid there is only one pair of contracts and therefore nopossibility of implication.

In general, grid elements for real and virtual contracts can be combinedin a rectilinear grid (e.g., item 501 of FIG. 8A or item 502 of FIG.8B). Although these may be resized and positioned arbitrarily on adrawing surface, the following rules of syntax are typically applied inthe illustrated implementations: (1) virtual contract zero is placed onthe left hand side; (2) for outright and spread contracts specified byproduct and delivery period, the products are placed in a verticalcolumn to the right of virtual contract zero and the delivery periods(e.g., months) are extended to the right; (3) for strip contracts (wherethe outright legs are either all buys or all sells), virtual deliveryperiods are placed to the right of the real delivery periods; (4) formulti-leg spreads (where if one outright leg is a buy the other legs areall outright sells and vice versa), the virtual products are placedbelow the real products and (5) for composite contracts, the gridelements may be grouped in any visually convenient manner (e.g., a fenceis associated with the delivery period of the future, so a fence gridcan be constructed by placing fence elements side-by-side for thedesired number of delivery periods).

FIG. 8A illustrates a simple grid 501 with one product, NG (naturalgas), and three real delivery periods: F (January), G (February) and H(March). In some implementations, the delivery period also may indicatethe year, e.g., F08 (January 2008). The leftmost column is associatedwith the virtual contract. Each grid element has a unique number. Inthis case, 0 is associated with the virtual contract and 1, 2 and 3 areassociated with NG delivery months.

FIG. 8B illustrates a somewhat more elaborate grid 502. The grid 502lists three products on its leftmost column, namely, unleaded gasoline(HU), heating oil (HO) and crude oil (CL). Again, the virtual contractgrid element 505 is numbered 0. Three real delivery months are listed onthe uppermost row, namely, F, G and H. Also shown is a virtual deliveryperiod (VFGH), corresponding to the months of a first quarter strip. Forpurposes of this illustration, there is no January CL contract.Accordingly, grid elements 503 and 504 are shaded and unnumbered toillustrate that no contract is associated with grid elements 503 and504. An order element may not be placed in grid elements 503 or 504.Again, each grid element has a unique number associated with it.

FIG. 8C illustrates how a visual grouping of grid elements facilitatesrepresenting contract states. An exchange will typically open and closeall the contracts in a specific product at the same time, but may havesome products open for trading when others are closed. The alignment ofgrid elements by product, makes it possible to express certain rules ofimplication visually. In other words, by placing products in a singlerow, it is possible to express a business constraint as a visualconstraint, e.g., all elements in the same row are marked identically.Here, the contracts that are closed for trading are shown with a linestruck through their corresponding grid element. Contracts that are nottradeable (e.g., no J, K, or M SC contract exists) are so indicated(“not tradeable”). This technique for representing the state of thecontract (open, closed, etc.) allows another important businessconstraint to be expressed visually. If a contract is closed, then it isnot possible to create an implied chain that passes through this gridelement. For example, if the outright contracts in CL are closed fortrading, then the match engine should not calculate any implied ordersthat have CL as a leg, e.g., an HU:CL spread and a CL:HO spread implyinga HU:HO spread. The heads and tails of order elements cannot be placedon grid elements that have been marked as closed.

When all the grids required to model a specific trading system have beenassembled, the nodes may be numbered. The relation of node numbers toproducts and delivery months is referred to as a node map and is part ofthe syntactic mapping that relates grid elements to attributes in XMLmessages or other entities used by, e.g., the automated test tool.

Basic orders may be combined with helper orders as shown in FIG. 9. Forclarity, grids are not shown. A basic order consists of buy parts andsell parts represented by solid circles and empty circles respectively.The buy circles are placed on the grid elements corresponding to the buycontracts and the sell circles are placed on the grid elementscorresponding to the sell contracts. If the basic order has helperorders, the buy parts or sell parts of the helpers are placed accordingto the same rules. Order combination 701 illustrates a primary buy order701 a for a quarterly strip. Helper orders 701 b-701 d are outright buysof the constituents of the strip, e.g., F, G and H crude oil.

Order combination 702 illustrates a primary sell order 702 a for aquarterly strip. Helper orders 702 b-702 d are outright sales of theconstituents of the strip, e.g., F, G and H crude oil.

Combination orders 703 and 704 illustrate the same 3:2:1 ratio spread inslightly different ways. Unlike the strip, where the volume in all ofthe legs is the same, the ratio spread buys 3 lots of CL and sells 2lots of HU and one lot of HO. The requirement to sell 2 lots of HU forevery lot of HO can be shown with two helper orders side by side as in703 a or with leg factors 704 c and 704 d. When the orders are shownwithout leg factors, the calculation of the price for the ratio spreadis similar to the calculation for the strip, i.e. all of the helpersparticipate equally. When leg factors are used the price must becalculated as a weighted average.

FIG. 10A illustrates example order elements with decorations. Some ofthe order elements, e.g., 801-807, are placed on the grid (e.g., of FIG.8A or 8B) whereas others modify the orders on the grid, e.g., orders 808and 809. This form is used if the order already appears on the grid andspares the user of the language from writing down redundant data. Order801 illustrates a basic order, i.e., a “bare order” without decoration.Order 801 does not indicate anything other what is being bought and whatis being sold by virtue of its placement on the grid. Order 802indicates the contract name (“CLX6:CLF7”, i.e., November 06 to January07 crude oil spread) and the legs (CLX6 and CLF7). These indicators maybe useful if the order details cannot be determined by the gridposition, or if the order is being illustrated off of the grid. Order803 includes Contract Identifiers (“CID”) as they would appear in an XMLmessage for a specific trading system. For example, if order 803 is theXML translation of order 802, [20] is the XML message that refers to theCLX6 leg, [33] refers to CLF7 leg and [360] refers to the CLX6:CLF7spread contract.

Order 804 indicates the price in external units (“P=0.20e”), the volume(V=5 lots) and the Order Number (the circled “1”) in the messagesequence. Order 805 illustrates a stop limit order, with a limit price(“0.20e”) and a trigger price (“T=0.18”). Since no volume is indicated,the default volume of one lot applies. In various implementations, thedefault volume may vary. The order number is shown as well (the circled“2”).

Order 806 indicates the external price (“0.20e”) and the internal (or“machine”) price (“−200000m”). External and internal pricing isdiscussed in the section entitled “Price Mapping.”

Order 807 modifies an existing order. When entered in this form, themodification replaces the existing order element on the grid. Themodification order 807 is given its own order number (the circled “4”)and also indicates which order it modifies (order 1). Generally, onlythe parameters that are being modified are shown on the order. In thisexample, order 1 is being modified to reflect a new price, i.e.,“P=0.21e.” Orders 808 and 809 are shorter ways of entering modificationorders. Order 808 accomplishes the same result as order 807. Order 809cancels order number 2. Order modifications carry an event numberbecause a modified order is sometimes required to take on the timepriority of its modification instead of its original time of entry. Thecancellation order is given its own order number (the circled “5”) sincethis is occasionally useful in expressing the sequence of events.

FIG. 10B illustrates additional types of input events, as well as timerevents. Timer events allow delay processing of input event by a certainnumber of “ticks,” each of which is a predetermined increment of time.An example of an administrative event is “Set Contract States”, e.g.,from pre-open to open. For this event, the specification in MEML willhave an initial state shown as a grid with orders, the event itself, anda final state also shown as a grid.

Orders (such as those shown in FIG. 10A) can be placed or arranged onthe grid in a variety of ways. FIG. 11 illustrates the same order grid,but with orders illustrated in three different ways. Each of theillustrated orders is to buy or sell NGK09 (natural gas, delivery May2009). In example 901, the sell order for NGK09 (order number 1) isplaced above the buy order for NGK09 (order number 2) because it is at ahigher price. This is an example of orders that will not trade. Example902 illustrates orders grouped visually by price level. Buy orders at ahigher price are toward the top of the grid whereas those at a lowerprice are toward the bottom. This orientation is useful in specifyinghow the match engine should process a large volume input order thatsweeps down through several levels. Example 903 illustrates orders inthe sequence in which they were received, i.e., by order number.

FIG. 12 illustrates the placement of primary sell order for a quarterlynatural gas strip 1001 and the associated sell orders 1002 in each ofthe constituent months. FIG. 12A shows how the strip order with itshelper orders can combine with three outright orders in the componentlegs. A trader can enter the strip order at the desired price of $10.The match engine will combine the strip with resting outrights in allbut one of its legs and publish the best implied outright in its marketdata. A trader that enters an order to match this implied outright willtrade with the strip and all of the other outrights. This procedureencourages traders to enter strip orders because they will be filled atthe best possible price. Also, FIG. 12 illustrates the placement of aprimary buy order for a quarterly natural gas strip 1003 and theassociated buy orders 1004 in each of the constituent months. Primaryorder 1001 and helper orders 1002 can trade against primary order 1003and helper orders 1004.

FIG. 13 illustrates the equivalent placement of primary orders 1101 and1104 and their helper orders 1102 and 1103.

Any combination of orders that allows a path to be traced from the buyend of the first order to the sell end of the last order can imply anorder drawn directly from the first buy contract to the last sellcontract. This principle is illustrated in FIGS. 14-16. The rules fordrawing an implied order depend on the states of the contractsrepresented by the grid elements, the chain descriptors in theimplication policy (if one exists, see FIG. 25) and the contracts thatexist in the match engine being modeled.

FIG. 14 illustrates an outright sell order 1201 for natural gas,February delivery (NGG). Spread order 1203 buys NGG, and sells naturalgas, March delivery (NGH). This implies an outright order 1201 for NGH.

FIG. 15 illustrates a spread order 1301 that buys HUF and sells HUG.Spread order 1302 buys HUG and sells HUH. Crack spread 1303 buys HUH andsells CLH. Spread order 1304 buys HUH and sells CLF. These orders implyan HUF:CLF crack spread order 1305.

FIG. 16 illustrates the definition of an implicable fence in MEML. Thefence is a type of option+future combination sometimes referred to as aposition or strategy, since trading systems in the past have typicallynot defined the more complex combinations as tradable products in theirown right. The helper orders make it possible for the resting put, calland future to imply the fence. They also make it possible for the traderto enter a fence order and have the match engine combine it with aresting call option order and a resting future order to imply the put. Atrader wanting to take this position can do so in a single transaction.This eliminates the problem of leg risk, where the trader attempts toput on the position with a series of independent transactions, leavinghim or her open to the risk of being caught with only part of theposition established before the market moves against them. A trader notsubject to leg risk can trade more aggressively, which in turn increasesthe overall volume traded at the exchange.

Once orders are placed on the grid, the match engine performs trades. Toperform a trade, the first order in time priority is taken from the gridand placed on a chain. FIG. 17 illustrates a single order 1510 for 3lots of an NGF10:NGH10 spread on the grid. This order is “followed by”(1502) or results in the chain 1503. This expression in MEML specifiesonly a small part of the sequence of operations required to process theincoming order 1501. Grid element 1 corresponds to chain element 1503 aand grid element 3 corresponds to chain element 1503 b. Order 1501connects the buy node of chain element 1503 a to the sell node of chainelement 1503 b. Thus, the specification calls for a resting trade path(consisting of only a single order in this case) to be created from theNGF10 contract to the NGH10 contract. In a full specification this wouldbe preceded by an input and followed by additional steps resulting intrades, market data and a final order state.

FIG. 18 illustrates three orders 1601-1603 on the grid. The first order,1601, is an outright sale of NGF10. The second order, 1602, is anNGF10:NGG10 spread. The third order, 1603, is an NGG10:NGH10 spread.This order is “followed by” (1604) or results in the chain 1606. Gridelement 0, i.e., for the virtual contract, corresponds to chain element1606 a. Grid element 1 corresponds to chain element 1606 b, grid element2 corresponds to chain element 1606 c and grid element 3 corresponds tochain element 1606 d. Order 1601 connects the buy node of chain element1606 a to the sell node of chain element 1606 b. Order 1602 connects thebuy node of chain element 1606 b to the sell node of chain element 1606c. Order 1603 connects the buy node of chain element 1606 c to the sellnode of chain element 1606 d. Thus, a trade path is created from thevirtual contract to the NGH10 contract, which implies an outright sellorder 1605 for NGH10.

As described in more detail herein, the movement of the order element(e.g., items 1501, 1601-1603) from the grid to the chain corresponds tothe selection of the best combination of resting orders.

FIG. 19 illustrates the creation of a trade circuit by connecting theends of the trade path with an input order. As described in connectionwith the semantic mapping, all cyclic permutations of the circuit willproduce the same trades. It is therefore possible to permute the circuitand break it at a different location to simplify certain calculations,such as the determination of leg prices. In particular, FIG. 19illustrates what occurs when the resting orders (e.g., those that are“on the book”) of FIG. 18 can be matched to an incoming order. Asdiscussed, the orders of FIG. 18 imply an outright sale of NGH10. InFIG. 19, an incoming order 1702 is added to the grid (via symbol 1701).Order 1702 is an outright buy of NGH10. This results in or leads to(1703) the chain elements 1606. Order 1702 completes a loop from the buynode of chain element 1606 d to the sell node of chain element 1606 a.

FIG. 20 illustrates the role of the trade builder element “→T” (1802).Although a chain representation allows a list of trades to be written atany time, not every chain corresponds to a trade. Chains may beconstructed to test the tradability of a path or permuted for legpricing. The trade builder element (1802) is used to indicate that asequence of activities that includes this chain requires trades to becommunicated to the trading network outside the match engine. In thiscase, the trade builder element (1802) indicates that: order 1 (1601)should be executed for V lots, order 2 (1602) should be executed for Vlots, order 3 (1603) should be executed for V lots and order 4 (1702)should be executed for V lots. Trade volume travels in the directionindicated by arrow 1801.

FIG. 21 is a table that illustrates some of the chain descriptors thatcan be formed from the visual and textual chain elements (see, e.g.,FIGS. 7A and 7B). The simplest of these is “FFIS,” where two outrightfutures in the same product but with different delivery periods imply acalendar spread. The abstract syntax for forming chain descriptors isrelated to the abstract syntax for placing orders on a grid. Forexample: (1) outright futures are adjacent to each other, e.g., FSSSSIF,SSFFSSIS and SSSSFIF are allowed, SSFSSIF is not; (2) the number ofoutright futures is zero or two; (3) if a pattern has a crack spread(“X”), there are either two outrights or another crack spread in thepattern and (4) if there are both calendar spreads (“S”) and crackspreads (“X”) in the pattern, there are least two of each, e.g., XSXISis valid but XSIS is not. A set of chain descriptors can be used tospecify an implication policy, as will be seen in the section onSemantic Mapping (see also FIG. 25). Thus, the chain descriptors can beused to program a match engine by indicating which combinations implyother markets.

Syntactic Mapping

The syntactic mapping relates expressions in the MEML to expressions inother languages. The mapping is syntactic because the translation of oneexpression to another can be defined purely in terms of the symbolsinvolved.

In some implementations, a contract is associated with a pair of gridelements (see, e.g., FIGS. 8A and 8B) in the match engine being modeledand with a contract identifier and contract symbol in the tradingnetwork as a whole. An order in the trading network is represented as anXML document constructed according to a schema. The order schema and therelationship between grid numbers and contract identifiers may be usedto construct a syntactic map.

An example of a mapped expression in the MEML is shown in FIG. 22. Theorder 2201 on the grid is to buy the November 2006-January 2007 crudeoil spread. The buy node is on grid element 62 and the sell node is ongrid element 362. It is labeled as order number 2, with a volume of 5 atthe price of −0.22. The syntactic mapping 2203 converts the order 2201into the XML expression 2202. The visual aspects of the order aretranslated into a textual expression. For example, the visual positionthat the November 2006-January 2007 crude oil spread occupies isreplaced with a numerical contract identification (“CID”). The CIDuniquely represents each tradable contract in a given trading system.The order number is translated as an “OID” value, the volume istranslated as a “TL” value and price is translated as a “Price” value.The direction of the arrow, i.e., that the order is a buy, is translatedinto the “BS” value.

In some implementations, the interaction with a terminal (e.g., a mouseclick) that places an order element on a screen display of a grid isassociated with executable code that calculates the new markets impliedby the new order. The visual properties of the order are mapped tonumerical values that can be passed as arguments to the executable code.The results of the calculation are displayed visually on the terminalscreen.

Semantic Domain

The Semantic Domain of the MEML consists of the real-world entities thatcan be represented by expressions in the language.

The real-world entities in the semantic domain of the MEML are states,input events, and output messages of a system for electroniccomputation, where the system has been described as a Finite StateMachine. These real-world entities are associated with physical statesof an electronic computer and its peripheral equipment. Generallyspeaking, any computing system can be described as a Turing Machine,which is a specific type of Finite State Machine. A modeling languagewhose semantic domain consists of match engines that can be described asFinite State Machines is capable of specifying every possible matchengine.

The operations of a match engine are generally executed by one or morecomputing systems, and may be performed in more than one part of atrading network or in related systems. For example, the calculation ofimplied markets may be done by traders at their trading stations insearch of arbitrage opportunities between trading networks or matchengines. It is also possible to perform these calculations outside atrading network for the evaluation of possible trading strategies, forinstruction, regulation or in the solution of other problems wheretrading is used as a model.

Definitions may vary, but generally speaking, a Finite State Machine hasthe following properties: (1) it is always in one of its finite numberof states, or making a transition from one state to another; (2) itchanges state only in response to external input events drawn from afinite event set; (3) it produces output (in the form of messages) onlywhen it makes a transition; and (4) it is described completely by a listof states and transition rules, e.g., if the machine is in state X andevent E occurs at the input, go to state Y and output message M_(XY).

The operations of a match engine may be described in the terminology ofthe Finite State Machine, e.g., as follows:

(1) input operations: (a) receiving an order from another component ofthe trading network in the form of an order message, (b) receiving arequest to modify or cancel a previously received order in the form of amodify or cancel message, (c) receiving administrative messages, e.g.,to open or close a set of markets and (d) receiving timer messagesrelated to events that occur on a regular basis;

(2) initial state: the match engines starts in a pre-defined initialstate;

(3) state transitions: each input event is associated with a processthat implements the transition rules associated with the current stateof the match engine, e.g., processes such as (a) storing a receivedorder, (b) canceling or modifying a previously stored order, (c)matching a received order against one or more previously stored ordersand calculating the matched trade information, (d) calculating impliedmarkets, (e) changing the state of a market and (f) changing animplication policy; and

(4) output operations: (a) acknowledgement, e.g., transmitting a messageto the sender of the input message to confirm its reception, (b)trading, e.g., transmitting matched trade data to another component ofthe trading system for ultimate communication with the affected traders,(c) Market Data, e.g., transmitting market data on real and impliedmarkets to other components of the trading network and (d)Administration, e.g., transmitting administrative messages such asinforming the sender of an administrative message that the requestedaction has (or has not) been carried out.

The state space of the match engine may be factored into a Cartesianproduct of independent state spaces. If the states in the independentstate spaces are assigned numbers, then the Cartesian product may berepresented as a vector of state numbers, with an element for eachindependent space. If the states in the independent state spaces areidentified visually, then a state in the Cartesian product is identifiedby an ordered arrangement of visual expressions.

The existence of a state in the state space does not imply that thestate is accessible, nor is it necessary to model every state of thematch engine with the MEML. For example, there may be a defined statewhere a closed contract contains orders, but this state will never bereached because the administrative message that closes a contract has atransition rule that requires the orders in that contract to be removed.

The factoring does not have to be complete in order to be useful. Forexample, a match engine may have one set of states where the outputmessages contain prices with decimal points and another set of stateswhere they do not. Although the MEML could be extended to cover thisbinary factor (e.g., by using different colors for otherwise identicalexpressions), in some implementations there is little practicaladvantage in doing so. The factoring may be expressed as the product ofwell-defined spaces for modeling with the MEML and a “remaining space”for which other methods may be more appropriate.

The first factoring expresses the state space of the match engine as theCartesian product of the contract space, the implication policy spaceand the remaining space.

The contract space is the Cartesian product of the individual contractspaces, each of which is the Cartesian product of the following: (1)contract market state, e.g., open or closed, (2) contract order state,defined by the values of the resting orders in a contract, e.g., ordersstored in the match engine “waiting” for a matching input order and (3)additional contract states, which may be defined as needed. The contractorder state changes when an order in a contract is added, removed ormodified, either directly or through trading.

The contract order state space has boundaries which may vary over thecourse of a trading day. If the boundaries can be adjusted with inputevents (e.g., an administrative message to change the state of a market)then the match engine must respond by transitioning to an order statewithin the allowed boundaries. For example, a contract in the open stateis not allowed to have crossed orders. However, a contract in thepre-open state is allowed to have crossed orders (where the bid pricesexceed the ask prices) because no trades can take place until the marketis opened. When an administrative message arrives to change the contractstate from pre-open to open, the match engine follows a specialprocedure called “leveling” to trade out the crossed orders in asystematic way.

The implication policy specifies which combinations of orders may beused to imply additional markets. Also, an implication policy can limitthe number of implied markets calculated by the match engine. Thisallows a general match engine to simulate the operation of a lesspowerful system. For example, a match engine that implements theunlimited combinations of outrights and spreads described incommonly-assigned U.S. Pat. No. 7,039,610 could have an implicationpolicy of {OOIS, OS . . . IO, S . . . OIO,S . . . SIS}, where theellipsis indicates an unlimited number of repetitions. Such a matchengine might be capable of trading strips, ratio spreads and arbitrarycombinations, but would be prevented by the implication policy fromdoing so.

Semantic Mapping

The semantic mapping associates expressions in the MEML with thereal-world entities they represent. As described above, these entitiesare the input events, states, transition rules and output messages ofthe Finite State Machine that describes the electronic computationsystem that implements the match engine. The entities will be describedin turn.

Input Events

An input event to the match engine is, e.g., (1) Add, (2) Modify, (3)Cancel, (4) Admin and/or (5) Timer. The input events are expressed asorders with decorators or related event symbols as shown in FIG. 10. Insome implementations, the occurrence of an input event corresponds tothe arrival of an XML message. The arrival of an XML message may haveoriginated as a order in the MEML format (e.g., of FIG. 10) that wasentered by an analyst using a terminal.

The occurrence of an event is depicted in the MEML by an order or eventsymbol, a state expression and a plus sign between them, as shown inFIG. 23. In the example of FIG. 23, order symbol 2301 corresponds toselling the January-February natural gas spread. The state expression2302 corresponds to the state of the market. In this example, nomatching orders are on the book.

A sequence of events may be depicted by a sequence of visualexpressions. However, this may be expressed more conveniently bydistorting the state grid and placing the orders according to FIG. 9 or24, e.g., ranking by price and time. This form of expression can be usedto describe the creation of a precondition for a subsequent event ofgreater interest. For example, the transition of a contract frompre-open to open requires a special procedure called leveling which iscomplex to describe and test, especially when large numbers of ordersare involved. Visual grouping of orders on an expanded grid can be usedto clarify which orders are traded at different steps in the leveling.

Price Mapping

Orders in the external world (i.e., from the perspective of a marketparticipant) may be either buys (bids) or sells (asks). The prices ofthese orders may be positive or negative, but in general a trade ispossible when the bid is equal or better than the asking price.

In the MEML there are two types of prices: (1) external (common, verbal)prices signified by an “e” in the concrete syntax and (2) internalmachine prices signified by an m.

In placing an order on a grid, buys and sells are distinguished by theirstarting and ending points. The external prices of buy orders aremultiplied by −1 and written with an “m” suffix. As a result, the sum ofthe machine prices of two prices that can trade will be equal to or lessthan zero.

The real-world criterion for tradability is mapped to the arithmeticcriterion of summing to zero or less. This makes it possible for anynumber of orders to be tested for tradability. Moreover, any number ofhypothetical trade sets can be constructed where all but one of theelements is present in the trade set matching system. The sum of themachine prices is the price that an incoming order must have to completethe set at a tradable price.

This technique may be applied generally and can be used to imply aresting order in any contract. Moreover, if more than one combination ofresting orders implies into a given contract, their summed prices may becompared to determine which set creates the best implied.

A secondary but useful effect of this price mapping in someimplementations is that lower is always better, since a greater bid ismapped onto a more negative (i.e., arithmetically lower) number. Thissimplifies the programming and reduces the chances of clerical errors.

States

A match engine has an initial state where it is ready to receive ordersbut has not yet received any. This is referred to as the “empty andopen” state and can be represented visually by a collection of gridssimilar to those illustrated in FIGS. 8A-8C.

Contract market state can be represented through grid decoration. In theform shown in FIG. 8C, there are only two states: open and closed. Inpractice there is no limit on the number of market states that may bedefined nor on the decorations that may be defined to represent them.

Order state can be indicated by the presence of order elements on agrid, e.g., as shown in FIG. 24. Orders for the same contract areprioritized (top to bottom) based on price and time (conveyed by theincreasing order numbers). In principle, any type of priority rule canbe expressed through the visual arrangement of order elements. In someimplementations, regulations (e.g., those set forth by the Securitiesand Exchange Commission) may affect ability of an exchange to prioritizeresting and incoming orders. Examples of allowed prioritizations couldbe expressed in MEML and used to create the test scenarios needed toverify that the relevant match engine complies with the regulations.

In some implementations, the order state of a match engine may bedisplayed on a computer screen. The orders may be grouped into pricelevels and only the levels of greatest interest (for example the bestbid and best ask) may be shown. Filtering and zooming may be used toexamine parts of the order state of particular interest. FIG. 24 is anexample screen shot of an order state of an example of a match engine,with the resting orders grouped by price and time.

Implication policy state can be defined by the number of the implicationpolicy currently in force. An implication policy is defined as a set ofchain descriptors indicating the allowed combinations. Some examples ofchain descriptors are illustrated in connection with FIG. 21. The chaindescriptors can be extended with wildcard characters and symbolsrepresenting the union of sets, intersection of sets, subtraction ofsets and the like, so that more complex policies can be expressedwithout having to enumerate all of the allowed combinations. FIG. 25illustrates two examples (2501 and 2502) of implication policies. Thefirst example 2501 is an example of an implication policy that permitsfirst generation implieds only. The second example 2502 is an example ofan implication policy that permits first and second generation implieds.The concept of first and second generation implied markets is discussedin commonly-assigned U.S. Pat. No. 7,039,610.

Admin messages can be used to change the implication policy (e.g., from2501 to 2502) as appropriate.

Transition Rules

The general form of a transition rule is “if in state X and event Eoccurs, go to state Y and output message M_(XY)”. This structure is aknown aspect of techniques for specifying computer programs.

The MEML is capable of expressing any rule of this kind by showing theinitial state, the input event, the final state and the message, asshown for a simple trade in FIG. 26. This alone would be sufficient tospecify the behavior of a trade matching system and serve as input tothe automated test tool.

In FIG. 26, the initial state 2602 comprises a resting order 2603 (i.e.,order number 1). The resting order 2603 is to sell 2 contracts of theJanuary-February natural gas spread, at an internal price of 0.19. Theinput event 2601 (i.e., order number 2) is to buy 5 contracts of theJanuary-February natural gas spread, at an internal price of 0.20. Thefinal state 2604 comprises order 2601, which is for the remaining volumeof three contracts after order 2601 trades against resting order 2603.

The MEML also may be used to derive the intermediate steps of theprocess used to compute the final state, as will be discussed herein.

Output Messages

Generally speaking, a match engine produces two types of data: (1)Trades messages and (2) Market Data messages. This data can betransmitted to other components of the trading network in many differentways. For example, the match engine can be coupled to a network (e.g.,local area, wide area, the internet, etc.) to which other components ofthe trading network are coupled. Also, the match engine can providevisual output to a display for viewing by traders (e.g., in a tradingpit).

For trade data, when two or more orders trade with each other, theoriginators or owners of the orders are informed of the specific ordersbeing traded, the trade price, the quantity traded and the time of thetrade. In the MEML, this data is obtained by iterating a chain as shownin FIG. 20. In some implementations, there is no expression in the MEMLto represent the output message since in practice the chain will eitherbe mapped syntactically to a message for a specific trade matchingsystem or to a visual display that does not need to be formally defined.Instead, the MEML provides the trade builder symbol “→T” to indicatethat the trade data available at this point in the process should beadded to the Trades message.

In some implementations, the chain is displayed on a computer screen(e.g., in a spreadsheet) and the changing of a parameter (e.g., an orderprice) causes the new trade data to be calculated automatically anddisplayed on another part of the computer screen. The “→T” symbol can bedisplayed on a button (e.g., 1802 of FIG. 20) which can open or closethe window used to display the trades data.

For market data, the users of the match engine are informed of theorders that are available for them to trade with. The exact data to besent to a specific trader may depend on criteria outside of the matchengine. For example, a match engine in a trading network where users canselect offers only from specified counterparties (“bilateral trading”)provides the relevant owner identification in its market data. A tradingnetwork without bilateral trading does not require this data from itstrade matching system.

In the MEML, the market data output for a given input event is obtainedby computing the difference between the initial order state and thefinal order state. In some implementations, there is no expression inthe MEML to represent the market data since in practice the statedifference will either be mapped syntactically to a message for thespecific trade matching system or to a convenient visual expression thatdoes not need to be formally defined. Instead, the MEML provides themarket data builder symbol “→MD” to indicate that the market dataavailable at this point in the process should be added to the marketdata message associated with the event.

In some implementations, the grids before and after the event aredisplayed on a screen. Clicking on market data icon causes thedifference to be calculated and displayed in a format consistent withthe market data from the trade matching system being modeled. Clickingon a trade data icon causes the new trade data to be calculatedautomatically and displayed on another part of the computer screen. Ascreen shot of such an implementation, already discussed in part, isshown in FIG. 26.

Adjacent to the final state 2604 are the trade data 2605 and market data2606 icons. Clicking either icon results in the generation of therespective trade data 2605 a or market data 2606 a. As shown, the tradedata 2605 a indicates that orders 1 and 2 traded against each other at avolume of 2 contracts and a price of 0.19. The market data 2606 aindicates that the available volume in the January-February spreadcontract has changed and that the ask at 0.19 has been deleted and 2lots bid at 0.20 has been added.

Pragmatics of the MEML

The pragmatics of a modeling language are formed by “the relation of itssigns to (human) interpreters.”

As previously discussed, the MEML can be used in a simple declarativemode to specify transition rules in the form of “input plus initialstate leads to output message and successor state. The MEML can also beused in the imperative or “conative” mode by a human designer to deriveexpressions showing what the trade set matching system “should” do intransitioning from one state to another.

The abstract syntax and a set of rules for transforming one expressioninto another make it possible to derive the final state visually (e.g.,the progression from 2602 to 2604 due to the event 2601 of FIG. 26). Thesteps in the derivation correspond to arithmetic operations performed onthe data representing the state and the event. A sequence of visualtransformations can be equivalent to a sequence of calculations, e.g.,as illustrated in FIG. 27. In general, the transformation rules can beapplied to any MEML expression (e.g., a new order type) to create analgorithm and ultimately a computer program to use in a match engine.

In FIG. 27, the column labeled “MEML” corresponds to input or outputexpressions in the MEML. The column labeled “FSM” corresponds to thestates of the Finite State Machine, i.e., the computer that implementsthe match engine. The column labeled “Program” corresponds to the inputand output of the computer program that implements the match engine.Accordingly, the initial MEML expression is input to the Finite StateMachine in its “initial state.” The initial MEML expression corresponds(via syntactic mapping) to input parameters to the code (e.g., compare2201 and 2202 of FIG. 22). Also, the code is in an initial state thatcorresponds to the initial state of the Finite State Machine. Afterprocessing, the outcome in the MEML expression and the calculatedresults in the computer program correspond to the final state of theFinite State Machine. When the computer program properly implements themodel set forth by the MEML, the results of the MEML calculation and thecomputer program are consistent.

The transformation rules for the MEML may express constraints placed onthe match engine by the business of electronic trading and as such, canvary from one exchange (or other entity that administrates the matchengine) to another. They may be considered either as a semantic mappingfor a specific exchange or as pragmatics of a language that can varyfrom one group of human users to another.

In some implementations, some or all of the following businessrequirements are incorporated into rules for transforming one MEMLexpression into another:

(1) Intercommodity spreads are only allowed between futures contractswith the same delivery month,

(2) Only the best implieds need to be reported in the market data,

(3) Resting orders trade in price-time priority,

(4) An implication policy can limit the number of implieds,

(5) Trade price is determined by the resting orders, and

(6) Leg prices in spread trades are based on the latest published price.

Regulatory compliance may require modification of these requirements, orthat additional or different requirements are incorporated into thetransformation rules. These rules make it possible to deriverepresentations and matching algorithms for new order types. Each ofthese rules will be discussed in turn.

Restriction of Intercommodity Spreads to a Common Contract Month

In some implementations, intercommodity spreads can only be definedbetween futures contracts with the same delivery period. For example,HOF8:CLF8 (Buy January 2008 Heating Oil:Sell January 2008 Crude) is anallowed spread whereas HOF8:CLG8 is not (Buy January 2008 HeatingOil:Sell February 2008 Crude).

In some implementations, the abstract syntax for constructing a gridrequires that futures with the same delivery periods be placed in avertical column. The business requirement that intercommodity spreads berestricted to common contract month is mapped onto the visualrequirement that orders be drawn either horizontally for calendarspreads or vertically for intercommodity spreads. In implementationshaving these rules, diagonal lines are not allowed on the grid. Note,however, that some implementations may not allow entry of orders thatrequire a diagonal line, but may imply non-tradeable markets thatrequire one or more diagonal lines on the grid.

Only Best Implieds are Reported

Implied orders (also referred to as implied markets) are reported in themarket data because they entice traders to buy or sell the opposingside. As shown in FIG. 28, this effect is most pronounced when theimplied order reduces the gap between the best bid and the best ask.FIG. 28 illustrates the observed relationship between the bid-ask gapand the likelihood of a trade. This graph shows the July 2006 e-miNYNatural Gas futures trading in their spot month on the NYMEX. Thehorizontal scale 2802 shows the spread in ticks and the vertical scale2801 shows the number of lots traded. Reducing the gap from 2 ticks to 1tick increases the volume by a factor of 10.

FIGS. 29 and 30 illustrate the creation of implied orders. A real orderconnects two grid elements. An implied order is formed by path of realorders connecting the same two endpoints. The selection of the bestimplied corresponds to finding the path with the lowest summed price.

FIG. 29 illustrates several combinations of sell orders for NG on grid2900. The first combination 2901 consists of three orders (1, 2 and 3)and the second 2902 and third 2903 each consist of two orders (4 and 5,and 6 and 7, respectively). The best implied order is the combination oforders with the lowest machine price. The implieds that correspond tocombinations 2901, 2902 and 2903 are shown as 2901 a, 2902 a and 2903 a,respectively. The calculation used to determine the machine price foreach order combination is shown at 2901 b, 2902 b and 2903 b. As shown,the combination of orders 6 and 7 (2903) yields the lowest machine price(14.9m), and accordingly is the best implied order. If the orders aretreated as edges and their machine prices as edge weights, then thecombination of 6 and 7 forms the shortest path from node 0 to node 5.

FIG. 30 illustrates several combinations of buy orders for NG on grid3000. The first combination 3001 consists of three orders (1, 2 and 3)whereas the second 3002 and third 3003 each consist of two orders (4 and5, and 6 and 7, respectively). The best implied is the combination oforders with the lowest machine price. The implieds that correspond tocombinations 3001, 3002 and 3003 are shown as 3001 a, 3002 a and 3003 a,respectively. The calculation used to determine the machine price foreach order combination is shown at 3001 b, 3002 b and 3003 b. In thiscase combination 3001 (i.e., orders 1, 2 and 3) yields the lowestmachine price, with a summed price of −14. The so-called “buy real sellvirtual spread” corresponds to a buy order in the real future (NGK) sothe machine price is multiplied by −1 to get an external price of$14.00.

Finding the path between two grid elements with the lowest summed pricesis equivalent to finding the shortest path between nodes in a graph, aproblem that can be solved using the techniques of graph theory.

Orders Trade in Price-Time Priority

If two or more resting orders have the same price, then price-timepriority requires that the first order entered be the first to trade. Inthe case of implied orders, the time priority of the implied isdetermined by the most recently entered real order, i.e., the order thatmakes the implied possible.

FIG. 31 illustrates an example of how this rule is applied. Two ordercombinations 3101 and 3102 are shown on the grid 3100. All of the ordersare for NG. Order combination 3101 comprises orders 2, 4 and 3. Ordercombination 3102 comprises orders 1 and 5. In this example, the ordernumbers correspond to the sequence in which the orders were entered.Accordingly, order 1 was entered first and order 5 was entered last. Theimplied order corresponding to combinations 3101 and 3102 are shown at3101 a and 3102 a, respectively. Price calculations 3101 b and 3102 billustrate that combinations 3101 and 3102 have no best price betweenthem.

However, the combination 3101 was created by order 4 and thus takesprecedence over the combination 3102 created by order 5. The impliedorder created first has the lowest time priority and is the first totrade. The advantage of this rule from a business standpoint is that itpreserves time priority within contracts. For example, if two realorders are entered in the same contract and result in parallel impliedorders, the time priority rule for implieds will cause these to betraded in their sequence of entry. Time priority values can be comparedin a similar manner to prices and the concept of a shortest pathcontinues to apply.

An Implication Policy May Limit the Calculation of Implieds

An implication policy limits the calculation of implied orders to thosecombinations whose chain descriptors (or order patterns) appear in thepolicy. A policy may be used for several reasons, for example, (1) toprevent the automated test tool from calculating implieds that the matchengine being tested does not calculate or (2) to model a reduction inthe scope of implied calculations in response to an administrativemessage or timer event.

FIG. 32 shows the effect of a policy 3201, which allows only “firstgeneration” implieds. Two combinations of orders 3202 and 3203 are shownon the grid 3200. All of the orders are for NG. Implied order 3203 acorresponds to combination 3203 (i.e., orders 1 and 7, shown asdecoration 3203 b) and implied order 3202 a corresponds to combination3202 (i.e., orders 2 through 6, shown as decoration 3202 b). The machineprice of implied order 3203 a, calculated at 3203 c, is −14m. Themachine price of implied order 3202 a, calculated at 3202 c, is lowerthan that of 3203 a at −15m. Also, the time priority of order 3202 a,calculated at 3202 d, is greater than that of 3202 a (calculated at 3203d). Nonetheless, the “first generation” policy 3201 rules out the longerchain 3202 even though it is lower in price and earlier in time.

Trade Price is Determined by the Resting Orders

The price of the trade is determined by the resting orders. This isillustrated in FIG. 26 for a trade set with two orders, i.e., anincoming real order trading with a resting real order. For larger tradesets, the general concept is illustrated in FIG. 19 for a trade set withfour orders without price decoration.

Once the trade set has been determined and the trade prices assigned,the orders form a cycle. The cycle can be rotated (i.e., the elementscan be permuted cyclically) without affecting the order trade prices.Invariance under cyclic permutation is illustrated in FIG. 33. Eachpermutation 3301-3304 yields identical order trade prices.

Leg Prices for Spreads are Determined by the Latest Published Price

When spread orders are included in the trade set, the trade prices forthe leg contracts must be computed in addition to the trade prices forthe spread orders themselves.

The inversion of buy order prices described in the semantic mappingmakes it possible to compute leg prices by iterating forward along thearrows and adding the prices on the links that connect the node vees inthe chain. The starting point of the iteration is either the virtualnode (representing an outright price) or the node vee corresponding tothe latest trade. This procedure is illustrated in FIG. 34.

In this example, the node for HOG (3401) serves as the anchor, and isthus the starting and ending point for the iteration 3403 of the chain3402. The buy node of HOG corresponds to the latest trade, and thus isthe starting point of the iteration 3403. The iteration 3403 thereforereorders the trades from A to E, alphabetically, to D, E, F, A, B, C.

In cases where the tick prices of the contracts in the chain and/or thelegs are not identical, the leg prices computed through simple additionmay not be exact multiples of the contract tick. If so, the leg pricemust be rounded to an on-tick price and each of the spread traders willexperience a gain or loss. If rounding is limited to the on-tick pricesone or two ticks upward or downward from the price obtained by simpleaddition, there will be a finite number of sets of on-tick leg pricesfor the trade cycle as a whole. The set of prices reported in the tradesmessage is selected according to a ranking function. In someimplementations, the ranking function is the sum of the squares of thetrader gains and losses. The highest rank is given to the set with thelowest sum. In some implementations, the ranking function is the maximumtrader loss. The highest rank is given to the set with the lowest valuefor the maximum loss.

Part II—Derivation of a Matching Algorithm for a New Order Type

An order is the trader's expression of intent to buy or sell an itemthat the trading system has designated as tradable. A trade takes placewhen a buy order is matched with a sell order. The trade is recorded bythe trading system and the transfer of money or other items of value issubsequently handled according to rules accepted by the traders whenthey placed their orders.

A tradable item may be a composite item that incorporates two or moreitems which are bought and sold in the same transaction. For example, insome implementations an offer to buy a calendar spread is defined as anoffer to buy the front month and sell the back month. In someimplementations, an offer to sell a calendar spread is an offer to sellthe front month and buy the back. In some cases, the buys and sells in acomposite item are defined for the order to buy the composite (i.e., totake on the position). The order to sell the composite has these buysand sells reversed.

The MEML, in some implementations, is based on the concept of a tradeset where the buys and sells in composite orders may be arranged in acycle. Some ways of doing this include:

(1) The composite has only one real buy or sell and is expressed as aspread to or from a common virtual contract.

(2) The composite is inherently a spread (buy one item and sellanother).

(3) The composite has all buys (or all sells). A virtual contract isdefined and helper orders are used to connect the virtual contract toreal contracts for implication. A rule is used in searching for paths tothe effect that all the helper orders must be traversed before the pathis complete.

(4) The composite has a single buy and multiple sells (or vice versa). Avirtual contract is defined and helper orders are used to connect thevirtual contract to real contracts for implication. A rule is used insearching for paths to the effect that all the helper orders must betraversed before the path is complete.

(5) The composite has an arbitrary number of buys and sells. Virtualcontracts are defined and helper orders are added to transform theparallel execution of orders into the sequential execution of orders andhelpers.

A real order is expressed as a direct connection between two nodes. Animplied order is created by any combination of real orders that form apath between the same two nodes, subject to any implication policy thatmay be in effect. An incoming order matches the resting real or impliedorder if the sum of the prices is zero or negative.

FIG. 35 illustrates a grid 3500 including a composite contract (a strip)and FIG. 36 illustrate the iteration of the grid. FIG. 35 illustrates anorder 3501 to sell the January-February-March natural gas strip. Theorder 3501 comprises three helper orders 3501 a-3501 c that sell naturalgas in each constituent month. There are two additional orders on thegrid, 3502 and 3503, which buy natural gas in January and February,respectively. These orders imply a market 3504 to sell March naturalgas. Accordingly, in grid 3500, when two outrights 3502 and 3503 arepresent, only one more outright order 3505 is required to complete acycle.

The cycle is shown in FIG. 36. The rule for this type of order, in thisimplementation, requires that all the helpers 3501 a-3501 c betraversed. The strip order (3501), its helpers (3501 a-3501 c), the tworesting outrights (3502 and 3503) and the matching outright (3505) arelaid out in the form of a trade cycle. The primary order appears threetimes in the chain due to traversal of all three helpers. The impliedprice is obtained by summing the prices of the orders in the chain, i.e.56+−50+56+−58=60 for the implied sell NGH (3504). This is matched by theincoming buy NGH order at −60 (3505).

Part III—Automated Test Tool

The Automated Test Tool executes a suite of tests defined in themodeling language and reports their pass/fail status. FIG. 2 indicateshow this activity fits into a typical software development process inwhich a trade matching system is constructed.

In some implementations, the specification for the trade matching systemconsists of a set of MEML expressions referred to individually asscenarios. The scenarios are mapped to sequences of XML messages whichare stored in files within the automated test system. The requiredoutputs are calculated using reference code and stored in files withinthe automated test system. The automated test system transmits themessages to the trade matching system under test and compares theresults with the stored references. An XSLT transformation or comparisonprogram is used to limit the comparison to outputs that were specifiedin the model, i.e., from transitions between states in the factoredstate space that was chosen for modeling. The automated test systemoutputs a status report indicating whether or not the outputs from thesystem under test correspond to those required by the MEML expressions.

FIG. 37 illustrates an implementation of an automated test tool 3700. Inthis implementation, the test tool 3700 comprises a terminal 3708 andone or more processors associated with blocks 3701-3707. Depending onthe implementation, the terminal 3708 may include one or more processorsutilized for blocks 3701-3707, while in some implementations one or morededicated processors are employed. Lines indicate communication betweenthe elements. The communication can be by way of any means, includingwired or wireless means.

A user at terminal 3708 enters scenarios in the MEML. To receive thescenarios in the MEML, the terminal can provide the user with a grid forentering trades (see, e.g., 8A, 8B, 8C, 14, 15 and 24 for exemplaryscreen shots of grids). The terminal 3708 is programmed or is coupled toprogramming that implements the MEML. The scenarios are stored in a MEMLScenarios data store 3701. A syntactic mapper 3702 converts the MEMLscenarios into XML code. The syntactic mapper can be implemented by oneor more processors that are informed by the syntactic mappingimplemented for the particular MEML. The XML output from the mapper 3702is stored in an XML data store 3703.

The XML data (either all or in part) is sent to two destinations. It issent to an XML data processor 3704 for processing and determining thefinal state as a result of the MEML scenario(s) provided at the terminal3708. It is also sent to a match engine that is being tested 3710. Thematch engine 3710 can be, for example, a match engine that is underdevelopment, a match engine that was recently updated, or a match enginethat is being tested before deployment at an exchange. The match engine3710 is capable of receiving the XML data from the XML data store 3703and processing it to determine a final state.

The output from the XML data processor (e.g., the final state(s)) isstored in a data processor output store 3705. This data, along with thefinal state(s) from the match engine under test 3710, is transmitted toa comparator 3706. The comparator 3706 compares the final statesdetermined by the XML data processor 3704 to those determined by thematch engine under test 3710. If the results (3707) indicate that theXML data processor 3704 and the match engine under test 3710 producedconsistent results, the match engine 3710 passes its test. However, amatch engine 3710 may not be suitable for deployment on an exchangeuntil some significant number of tests have been passed.

The test results 3707 are communicated to the terminal 3708 so that theuser can take appropriate action. For example, a user may reprogram thematch engine 3710, certify the match engine 3710 for deployment, orpostpone deployment of the match engine due to inconsistencies with theXML data processor output.

FIG. 38 illustrates an example screen shot 3800 that, e.g., a user ofterminal 3708 of FIG. 37 might encounter when interacting with animplementation of the automated test tool. In one portion of the screen3800, a user can define an initial state of the market 3802 as well asan incoming order 3801. In this example, the initial state 3802 includesa spread 3803, against which the incoming order 3801 may trade. Whilethis initial state 3802 is rather simple (to facilitate illustration),the initial state may be more complex and resemble, for example, FIG.24. The user may use the commands on the screen (3805) to build initialstates and incoming orders, and to instruct the test tool to calculatethe final state 3804 (which comprises remaining order 3808). Once thetest tool calculates the final state 3804 utilizing the MEML, thescenario (e.g., consisting of an XML transformation of the initial state3802 and the incoming order 3801) may be sent to the match engine undertest by actuating button 3806. The final state calculated using the MEML(3804) is then compared to the final state calculated by the matchengine under test. The result is reported in window 3807.

FIG. 39 illustrates an example business methodology that can beimplemented with the automated test tool 3700. As shown, businessanalysts, software architects and project managers define use cases,which represent business requirements for a given match engine.Developers deploy the match engine defined by the requirements on thetest system 3700. A test manager, based on the use cases, develops atest plan that is shared with one or more testers who use the testsystem 3700 to test the match engine. The status of the tests arereported back to the test manager, who informs the project manager ofstatus.

Various features of the system may be implemented in hardware, software,or a combination of hardware and software. For example, some features ofthe system may be implemented in computer programs executing onprogrammable computers. Each program may be implemented in a high levelprocedural or object-oriented programming language to communicate with acomputer system or other machine. Furthermore, each such computerprogram may be stored on a storage medium such as read-only-memory (ROM)readable by a general or special purpose programmable computer orprocessor, for configuring and operating the computer to perform thefunctions described above.

A number of embodiments of the invention have been described.Nevertheless, it will be understood that various modifications may bemade without departing from the spirit and scope of the invention.Accordingly, other embodiments are within the scope of the followingclaims.

1. A computer-implemented method for specifying and testing a matchengine comprising: providing a user interface, coupled to the matchengine, for receiving commands, the interface comprising atwo-dimensional grid, wherein along the first dimension of the grid oneor more products are identified and along the second dimension of thegrid one or more dates are identified, the intersection of a givenproduct and a given date corresponding to a particular contract, thegrid further comprising one or more regions corresponding to a virtualcontract that is not associated with a product or a date; receiving, viathe user interface, a first set of one or more commands corresponding toa set of orders, wherein the first set of orders comprises one or moreorders for a contract that are not tradeable against each other;identifying any markets implied by the first set of orders; outputtingmarket data corresponding to the results of the determining; receiving,via the user interface, a second set of one or more commandscorresponding to a second order for a contract; determining if thesecond order is tradable against any subset of orders or markets drawnfrom the first set; and outputting data corresponding to the results ofthe determining.
 2. The method of claim 1 wherein the determiningcomprises selecting one or more subsets for trading according to apriority rule.
 3. The method of claim 2 wherein the priority rule isbased on the price and time of the orders in the subset.
 4. The methodof claim 1 wherein the purchase or sale of a particular contract isrepresented on the grid by connecting a virtual contract to theparticular contract.
 5. The method of claim 1 wherein the purchase orsale of a particular contract is represented on the grid by connectingtwo particular contracts, of which the particular contracts form the buyleg and the spread leg of a spread contract.
 6. The method of claim 1where the purchase or sale of an arbitrary combination of contracts isrepresented on the grid as a single tradable contract.
 7. The method ofclaim 6 wherein the number of lots to trade in each arbitrarycombination of contracts is specified by one or more ratios or legfactors, wherein the ratios or leg factors are at least one of: (i)present in the original definition of the contract on the grid or otherinitial state of the match engine, or (ii) specified by the sender of anorder or administrative message.
 8. The method of claim 1 where the gridhas one or more dimensions, each corresponding to the number ofparameters required to identify a tradable instrument.
 9. The method ofclaim 8 wherein the instrument is associated with a future, option,security, index or emission credit.
 10. The method of claim 1 whereinthe identifying comprises: accessing a parameter that defines the extentof implied market calculation; calculating implied markets in accordancewith the parameter.
 11. The method of claim 10 wherein the parameter ispresent in the definition of the contract on the grid, the initial stateof the match engine, or specified by the sender of an order oradministrative message.
 12. The method of claim 1 wherein theidentifying comprises: accessing a parameter that defines the types ofmarkets that may be implied by a given set of orders; calculatingimplied markets in accordance with the parameter.
 13. The method ofclaim 1 wherein receiving via the user interface comprises at least oneof: receiving one or more instructions to alter the properties ofpreviously received orders; receiving one or more instructions to alterthe properties of previously received orders where the time priority ofthe modified order is set according to rules derived from a businessrequirement; receiving one or more instructions to cancel previouslyreceived orders; receiving one or more instructions to change the stateor states of contracts; receiving one or more instructions to change theproperties of contracts not directly related to their market state; andreceiving one or more messages to change the definition of the grid,including the activation, addition, deactivation or removal ofcontracts.
 14. The method of claim 13 wherein the properties include oneor more of price and volume.
 15. A method of testing a match enginecomprising: generating a model of a first match engine, whereingenerating the model comprises a set of expressions in a domain specificvisual modeling language (DSVL), selecting a set of trading scenarios ina format associated with the DSVL, the trading scenarios comprising anysequence of messages that the match engine is capable of receiving,regardless of whether these messages result in a trade; coupling toexecutable code corresponding to a second match engine; converting thetrading scenarios into instructions compatible with the executable code;providing the instructions to the executable code for execution of thetrading scenarios; executing the trading scenarios with the model of thefirst match engine; and comparing the results of executing the tradingscenarios by the model of the first match engine and the second matchengine.
 16. The method of claim 15 wherein the instructions comprise XMLcode.
 17. The method of claim 15 wherein the model of the first matchengine comprises a reference for the functionality of the second matchengine.
 18. A computer-implemented method for interfacing with a matchengine, the method comprising: providing an interface for receivinginstructions, the interface comprising a grid that comprises one or moreregions each corresponding to a tradable futures contract, security, orother tradable item for which orders can be matched by the match engine,as well as one or more regions corresponding to a virtual contract thatis not associated with a tradable item; receiving, via the interface,one or more symbolic instructions from a user, each instructionassociated with one or more tradable items, the instruction comprising asymbol placed on the grid; executing the instructions on the matchengine; and displaying to the user the results of the executing.
 19. Themethod of claim 18 wherein the instructions relate to buying or sellinga particular tradable item.
 20. The method of claim 18 wherein thesymbolic instruction relates to buying or selling a particular tradableitem.
 21. The method of claim 20 wherein receiving a symbolicinstruction to sell a particular tradable item comprises: receiving asell symbol on the grid proximate to the intersection associated withthe particular tradable item; receiving a buy symbol on the grid in aregion corresponding to a virtual contract; and visually connecting thesell and buy symbol on the grid.
 22. The method of claim 20 whereinreceiving a symbolic instruction to buy a particular tradable itemcomprises: receiving a buy symbol on the grid proximate to theintersection associated with the particular tradable item; receiving asell symbol on the grid in a region corresponding to a virtual contract;and visually connecting the buy and sell symbol on the grid.
 23. Themethod of claim 18 wherein the symbols comprise visual indications thatrelate to one or more of: the identity of a particular tradable item;whether a particular tradable item is being bought or sold; the price atwhich a particular tradable item is being bought or sold; the quantityof which a particular tradable item is being bought or sold; themodification of a previously received instruction; or the cancellationof a previously received instruction.
 24. The method of claim 18 whereinsymbols on the grid relate to buying or selling a particular tradableitem, the method comprising: sequencing instructions on the gridrelating to a particular securities contract on the basis of one or moreof price or the order in which the instructions were received.
 25. Acomputer implemented method of defining a market, the method comprising:providing a rectilinear grid having at least one row and at least onecolumn, the grid comprising grid elements wherein each grid elementcorresponds to a virtual contract or a tradable instrument, the gridelements being arranged spatially on the rectilinear grid such thattradeable orders may be drawn in directions only parallel to either arow or a column; defining an initial state of the market by receiving aninstruction in a visual language, the instruction comprising a requestto buy or sell a virtual contract or a tradeable item; receiving anorder in a visual language, the order comprising a request to buy orsell a virtual contact or a tradeable item; determining if the order istradeable against the initial state of the market; and providing theresults of the determining.
 26. The method of claim 25 wherein thevisual language is a DSVL.
 27. The method of claim 25 wherein at leastsome columns of the grid correspond to products and at least some rowsof the grid correspond to dates.
 28. The method of claim 25 whereinreceiving an order in a visual language, the order comprising a requestto sell a particular tradeable item, comprises: receiving a sell symbolon the grid element corresponding to the particular tradeable item;receiving a buy symbol on the grid element corresponding to a virtualcontract; and visually connecting the sell and buy symbol on the grid.29. The method of claim 28 wherein receiving an order comprises at leastone of: receiving decorations that specify the price and volume of theorder; receiving decorations that specify at least one propertyassociated with the contract; and receiving one or more instructions tochange the definition of the grid.
 30. The method of claim 29 whereinthe at least one property includes at least one of (i) market state or(ii) leg factors or ratios associated with combinations.
 31. The methodof claim 29 wherein the instructions to change the definition of thegrid include at least one of activation, addition, deactivation, orremoval of contracts.
 32. The method of claim 26 wherein receiving anorder in a visual language, the order comprising a request to buy aparticular tradeable instrument, comprises: receiving a buy symbol onthe grid element corresponding to the particular tradeable instrument;receiving a sell symbol on the grid element corresponding to a virtualcontract; and visually connecting the buy and sell symbol on the grid.33. The method of claim 25 comprising: assigning a numericidentification to each grid element; translating the initial state ofthe market into one or more XML messages, wherein an instructionassociated with a given grid element in the XML message comprises itsrespective numeric identification.
 34. The method of claim 33comprising: translating the order into one or more XML messages.
 35. Themethod of claim 34 wherein providing the results of the determiningcomprises transmitting the XML messages to a processor.
 36. A system fortesting a match engine comprising: a match engine having an input portfor receiving data corresponding to instructions and an output port fortransmitting first result data, the result data comprising the resultsof processing instructions; a testing sub-system comprising: a userinterface for receiving a trading scenario in a visual language, thevisual language being governed a rule set; a first processing resourcecoupled to the interface for converting the trading scenario toinstructions corresponding to the trading scenario in a second language;a communication resource coupled to the input port of the match enginefor transmitting the instructions to match engine and further coupled tothe output port of the match engine for receiving the first result data;a second processing resource for processing the instructions accordingto the rule set of the visual language and generating second resultdata; a comparator for comparing the first result data to the secondresult data.
 37. The system of claim 36 wherein the visual language is aDSVL.
 38. The system of claim 36 wherein the second language is XML. 39.The system of claim 36 wherein the communication resource comprises anetwork.
 40. The system of claim 36 wherein the first processingresource and second processing resource are implemented with a singleprocessor.
 41. The system of claim 36 wherein the user interface isimplemented on a personal computer.
 42. The system of claim 36comprising a first data store for storing the trading scenario.
 43. Thesystem of claim 42 wherein the first data store is coupled to at leastone of the interface and the first processing resource.
 44. The systemof claim 36 comprising a second data store for storing the instructions.45. The system of claim 44 wherein the second data store is coupled toat least one of the first processing resource, the second processingresource and the communication resource.
 46. The system of claim 36comprising a second data store for storing first result data.
 47. Thesystem of claim 46 wherein the second data store is coupled to at leastone of the second processing resource and the comparator.